package com.argticling.dao.impl;

import java.util.ArrayList;
import java.util.List;

import com.argticling.dao.impl.hibernate.HibernateUtil;
import org.hibernate.Session;

import com.argticling.dao.interf.PrivilegeDAO;
import com.argticling.model.privilege.Privilege;

public class PrivilegeDAOImplementation extends AbstractDAOImplementation  implements PrivilegeDAO {

    public Privilege getPrivilegeById(String id) {
    	List<Privilege> privileges = new ArrayList<Privilege>();
		Session session = new HibernateUtil().getSession();
		try {
			String query = "from Privilege where id ='" + id + "' ";
			privileges = session.createQuery(query).list();
		} finally {
			session.close();
		}
		return privileges.get(0);
    }
}
